package com.nut.spp.jbb;

import com.nut.spp.api.req.PrepayReq;
import com.nut.spp.api.resp.PrepayResp;
import com.nut.spp.common.PayInfo;
import com.nut.spp.common.RefundInfo;
import com.nut.spp.jbb.req.CorpReq;
import com.nut.spp.jbb.req.SettleReq;

public interface JbbService {

    //https://jbb-web.jbbks.com/userinfo/unified_user/union/inlet/1586812994

    /**
     * 用户最近的社员
     */
    String BASE_URL = "https://jbb-web.jbbks.com";

    //结算
    String SETTLE = BASE_URL + "/common/api/settle";

    //企业认证
    String CORP_CREATE = BASE_URL + "/common/api/corpMember/create";

    //获取微信openId
    String GET_OPEN_ID = BASE_URL + "/weChat/getOpenId";

    //微信accessToke
    String GET_ACCESS_TOKEN = BASE_URL + "/weChat/getAccessToken";

    //获取Signature
    String GET_SIGNATURE = BASE_URL + "/weChat/getSignature";

    //短信校验
    String SMS_CHECK = BASE_URL + "/common/api/sms/";

    //获取短信验证码，一分钟一次
    String SEND_SMS = BASE_URL + "/common/api/sms/";

    //用户最近的社员
    String USER_UPPER = BASE_URL + "/userinfo/unified_user/union/cor?phone=";

    //店铺入驻资格
    String USER_CHECK = BASE_URL + "/userinfo/unified_user/union/inlet/";

    //获取物流
    String GET_TRACES = BASE_URL + "/common/api/getTraces/{logisticsNo}";

    //阿里文件上传
    String OSS_POLICY = BASE_URL + "/common/api/upload/policy";

    //阿里云文件上传回调
    String OSS_CALLBACK = BASE_URL + "/common/api/upload/callback";

    //获取支付方式
    String PAYMENT_METHOD = BASE_URL + "/common/api/payment/method";

    //查询支付结果
    String PAYMENT_QUERY_RESULT = BASE_URL + "/common/api/result/";

    //调起支付
//    String PAYMENT_PREPAY = BASE_URL +"/common/api/pay/{paymentMethod}/{paymentClient}";

    //wx_pub,alipay_qr

    String PAYMENT_PREPAY = BASE_URL + "/common/api/pay/";

    //退款
    String REFUND_URL = BASE_URL + "/common/api/refund/";


    /**
     * 用户最近的社员
     * @param mobile
     * @return
     */
    String userUpper(String mobile);

    /**
     * 店铺入驻资格
     * @param mobile
     * @return
     */
    Boolean userCheck(String mobile);

    void sendSms(String mobile);

    Boolean smsCheck(String mobile, String code);

    String corpCreate(CorpReq req);

    void queryPayWay();

    PrepayResp payPrepay(PrepayReq req);

    /**
     * @param payNo
     * @return true 已支付
     */
    PayInfo queryPayResult(String payNo);

    RefundInfo refund(String payNo, Integer money);

    /**
     * 结算
     * @param req
     */
    void settle(SettleReq req);

}
